*Paper: Fiscal Rules, Corruption and Electoral Accountability - Replication Files

clear all
cap log close 
set more off


**Global files
global folder "/Users/tommasogiommoni/Dropbox/Determinants of corruption/Stability pact and corruption/Replication files JOP"


********************************************************************************
****----						Dataset open 					    	----**** 
********************************************************************************

use "$folder/Data/dataset_feb2024.dta", clear

**-- Global

global controls7 proportion_female_Elected_lag av_education_Elected_lag av_age_Elected_lag  victory_margin_lag term_limit_lag 
global controls7_int  c.proportion_female_Elected_lag##i.anno c.av_education_Elected_lag##i.anno c.av_age_Elected_lag##i.anno c.victory_margin_lag##i.anno  c.term_limit_lag##i.anno
global controls8_int  c.proportion_female_Elected_lag##i.anno c.av_age_Elected_lag##i.anno

**-- Panel dataset

xtset codcom anno
fvset base 2012 anno

**-- Additional cleaning

gen first_term=0 if term_limit==1
replace first_term=1 if term_limit==0

gen election_postReform=(year_election==2013 & anno>2013)
replace election_postReform=1 if year_election==2014 & anno>2014

********************************************************************************
****----						Analysis 					    		----**** 
********************************************************************************

qui reghdfe corruption_PC_sd S##T##electoral_period P  i.region_year $controls7_int  if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & election_postReform==0, absorb(codcom) vce(cluster codcom)
est store reg1
qui reghdfe corruption_PC_sd S##T##term_limit P  i.region_year $controls8_int  if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & election_postReform==0, absorb(codcom) vce(cluster codcom)
est store reg2

qui reghdfe corruption_exp_log_sd S##T##electoral_period P  i.region_year $controls7_int  if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & election_postReform==0, absorb(codcom) vce(cluster codcom)
est store reg11
qui reghdfe corruption_exp_log_sd S##T##term_limit P  i.region_year $controls8_int  if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & election_postReform==0, absorb(codcom) vce(cluster codcom)
est store reg21
 
esttab reg1 reg11 reg2 reg21 using "$folder/Tables/TableA6.tex", compress keep(1.S#1.T 1.S#1.T#1.electoral_period 1.S#1.T#1.term_limit) label nobaselevels se r2  staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace
